using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Yoozoo.UI;
public class YDragButtonBinderTreeItem : BindingBinderTreeItemBase
{
    public static Dictionary<YDragButtonBinder.AttributeType, LinkerValueState> AttributeValueDic = new Dictionary<YDragButtonBinder.AttributeType, LinkerValueState>
    {
        {YDragButtonBinder.AttributeType.onDrag, LinkerValueState.UnityEvent2Vector2},
        {YDragButtonBinder.AttributeType.onDragOut, LinkerValueState.UnityEvent2Vector2},
        {YDragButtonBinder.AttributeType.onDragBegin, LinkerValueState.UnityEvent2Vector2},
        {YDragButtonBinder.AttributeType.onDragEnd, LinkerValueState.UnityEvent2Vector2},
        {YDragButtonBinder.AttributeType.onDragOutEnd, LinkerValueState.UnityEvent2Vector2},
        {YDragButtonBinder.AttributeType.onClick, LinkerValueState.UnityEvent2},
        {YDragButtonBinder.AttributeType.onDoubleClick, LinkerValueState.UnityEvent2},
        {YDragButtonBinder.AttributeType.onLongClick, LinkerValueState.UnityEvent2},
        {YDragButtonBinder.AttributeType.onLongPress, LinkerValueState.UnityEvent2},
        {YDragButtonBinder.AttributeType.onDown, LinkerValueState.UnityEvent2},
        {YDragButtonBinder.AttributeType.onUp, LinkerValueState.UnityEvent2},
        {YDragButtonBinder.AttributeType.onInteractiveChange, LinkerValueState.UnityEvent2},
        {YDragButtonBinder.AttributeType.onPointerExit, LinkerValueState.UnityEvent2},
        {YDragButtonBinder.AttributeType.onPointerEnter, LinkerValueState.UnityEvent2},
        {YDragButtonBinder.AttributeType.interactable, LinkerValueState.Boolean},
        {YDragButtonBinder.AttributeType.enabled, LinkerValueState.Boolean},
    };
    public YDragButtonBinderTreeItem() : base(typeof(YDragButtonBinder))
    {
    }
    
    public override void RebuildTree()
    {
        base.RebuildTree();
        foreach (YDragButtonBinder.AttributeType binderType in Enum.GetValues(typeof(YDragButtonBinder.AttributeType)))
        {
            BindingLinkerTreeItem linkerTreeItem = new BindingLinkerTreeItem(binderType.ToString(), binderType.ToString(), (int)AttributeValueDic[binderType]);
            AddChild(linkerTreeItem);
        }
    }
}